package com.lmonkey.servlet.comment;

import com.lmonkey.servic.COMMENTDao;
import com.lmonkey.shop.COMMENT;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/admin/admin_tocommentupdate")
public class CommentUpdate extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //设置字符集
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=utf-8");
        //获取参数
        String id = request.getParameter("id");
        //从数据库获取数据
        COMMENT pl = COMMENTDao.selectByid(id);
        request.setAttribute("pl",pl);
        request.setAttribute("cpage",request.getParameter("cp"));
        request.setAttribute("keykords",request.getParameter("keywords"));
        //跳转
        request.getRequestDispatcher("admin_commentmodify.jsp").forward(request,response);
    }
}
